<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('联系方式列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:information:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('front:information:edit')}]];
        var removeFlag = [[${@permission.hasPermi('front:information:remove')}]];
        var prefix = ctx + "front/contactInformation";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "联系方式",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'address',
                    title: '机构地址'
                },
                {
                    field: 'servicePhone',
                    title: '服务电话'
                },
                {
                    field: 'supervisePhone',
                    title: '监督电话'
                },
                {
                    field: 'superviseDept',
                    title: '监督部门'
                },
                {
                    field: 'superviseDeptLink',
                    title: '监督部门链接'
                },
                {
                    field: 'email',
                    title: '邮箱'
                },
                {
                    field: 'serviceDate',
                    title: '服务时间'
                },
                {
                    field: 'copyright',
                    title: '版权所有'
                },
                {
                    field: 'copyrightLink',
                    title: '版权所有链接'
                },
                {
                    field: 'businessCommittee',
                    title: '商务委名称'
                },
                {
                    field: 'businessCommitteeLink',
                    title: '商务委链接'
                },
                {
                    field: 'copyrightPictureUrl',
                    title: '版权图片',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'copyrightPictureLink',
                    title: '版权图片链接'
                },
                {
                    field: 'type',
                    title: '类型',
                    formatter: function(value, row, index) {
                        if(row.type==1){
                            return '底部联系我们';
                        }else if(row.type==2){
                            return '右边浮窗';
                        }else if(row.type==3){
                            return '援助热线';
                        }else if(row.type==4){
                            return '平台介绍中的联系我们';
                        }else{
                            return '通用';
                        }
                        // var actions = [];
                        // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        // return actions.join('');
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>